﻿using LD.Host;
using System;

namespace LD.Tool
{
    public partial class ToolWipFrm : FrmToolBase
    {
        public ToolWipFrm()
        {
            InitializeComponent();
            this.Shown += ToolMesSharpFrm_Shown;
            this.btn_ok.Click += Btn_ok_Click;
        }

        private void ToolMesSharpFrm_Shown(object sender, EventArgs e)
        {
            Init();
        }

        private void Init()
        {
            if (TB_Tool.Param != null)
            {
                ResultType okng = (ResultType)Enum.Parse(typeof(ResultType), TB_Tool.Param);

                this.rab_ok.Checked = okng == ResultType.OK ? true : false;
                this.rab_ng.Checked = okng == ResultType.NG ? true : false;
            }
        }

        private void Btn_ok_Click(object sender, EventArgs e)
        {
            TB_Tool.Param = this.rab_ok.Checked ? ResultType.OK.ToString() : ResultType.NG.ToString();
        }
    }
}
